﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using VINETLIFE.BL;
using VINETLIFE.DO;

namespace VINETLIFE.Module
{
    public partial class ucQC2ben : System.Web.UI.UserControl
    {
        public string LinkLeft = "";
        public string LinkRight = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (new sysConfigBL().Select(new sysConfigDO() { ConfigID = 4 }).IsActive == true)
                {
                    LinkLeft = new sysConfigBL().Select(new sysConfigDO() { ConfigID = 4 }).ConfigValue;
                    divLeft1.Visible = true;
                    divLeft2.Visible = true;
                }
                else
                {
                    divLeft1.Visible = false;
                    divLeft2.Visible = false;
                }
                if (new sysConfigBL().Select(new sysConfigDO() { ConfigID = 31 }).IsActive == true)
                {
                    LinkRight = new sysConfigBL().Select(new sysConfigDO() { ConfigID = 31 }).ConfigValue;
                    divRight1.Visible = true;
                    divRight2.Visible = true;
                }
                else
                {
                    divRight1.Visible = false;
                    divRight2.Visible = false;
                }
                string url = Request.Url.AbsolutePath;
                url = url.Substring(1, url.Length - 1);
                string url1 = url.Replace(".", "/");
                string Module = url1.Substring(0, url1.IndexOf("/"));
                if (Module.Equals("") || Module.ToLower().Contains("default"))
                {
                    ltrScroll.Text = "<script type='text/javascript' src='/js/js-scroll.js'></script>";
                    divHome.Visible = true;
                    divPage.Visible = false;
                }
                else
                {
                    ltrScroll.Text = "<script type='text/javascript' src='/js/js-scroll-page.js'></script>";
                    divHome.Visible = false;
                    divPage.Visible = true;
                }
            }
        }
    }
}